package indi.zhifa.study2024.nbr.controller;

import indi.zhifa.core.common.web.entity.ann.ZhiFaRestController;
import indi.zhifa.study2024.nbr.business.curd.storage.entity.request.InvInRequest;
import indi.zhifa.study2024.nbr.business.curd.storage.entity.response.InvInResponse;
import indi.zhifa.study2024.nbr.business.curd.storage.service.IItemInventoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@Slf4j
@Validated
@RequiredArgsConstructor
@RequestMapping(value = "/class002/nbr/curd/inv")
@ZhiFaRestController
@Tag(name = "商品库存增删改查")
public class ItemInventoryController {

    private final IItemInventoryService mItemInventoryService;

    @Operation(summary = "仓库进货")
    @PostMapping("/stock/{id}")
    public InvInResponse stockGood(@PathVariable(name = "id") Long pId, @RequestBody InvInRequest pInvInRequest){
        return mItemInventoryService.stockGood(pId,pInvInRequest);
    }

}
